Optimal. Leaf size=126 \[ \frac {5}{16} a \left (a^2+b^2\right )^2 x+\frac {5 a \left (a^2+b^2\right ) (b+a \cot (c+d x)) (a-b \cot (c+d x)) \sin ^2(c+d x)}{16 d}+\frac {5 a (b+a \cot (c+d x))^3 (a-b \cot (c+d x)) \sin ^4(c+d x)}{24 d}+\frac {(b+a \cot (c+d x))^5 \sin ^6(c+d x)}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3167, 819, 737,
209} \begin {gather*} \frac {5 a \left (a^2+b^2\right ) \sin ^2(c+d x) (a \cot (c+d x)+b) (a-b \cot (c+d x))}{16 d}+\frac {5}{16} a x \left (a^2+b^2\right )^2+\frac {\sin ^6(c+d x) (a \cot (c+d x)+b)^5}{6 d}+\frac {5 a \sin ^4(c+d x) (a \cot (c+d x)+b)^3 (a-b \cot (c+d x))}{24 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 737
Rule 819
Rule 3167
Rubi steps
\begin {align*} \int \cos (c+d x) (a \cos (c+d x)+b \sin (c+d x))^5 \, dx &=-\frac {\text {Subst}\left (\int \frac {x (b+a x)^5}{\left (1+x^2\right )^4} \, dx,x,\cot (c+d x)\right )}{d}\\ &=\frac {(b+a \cot (c+d x))^5 \sin ^6(c+d x)}{6 d}-\frac {(5 a) \text {Subst}\left (\int \frac {(b+a x)^4}{\left (1+x^2\right )^3} \, dx,x,\cot (c+d x)\right )}{6 d}\\ &=\frac {5 a (b+a \cot (c+d x))^3 (a-b \cot (c+d x)) \sin ^4(c+d x)}{24 d}+\frac {(b+a \cot (c+d x))^5 \sin ^6(c+d x)}{6 d}-\frac {\left (5 a \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {(b+a x)^2}{\left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{8 d}\\ &=\frac {5 a \left (a^2+b^2\right ) (b+a \cot (c+d x)) (a-b \cot (c+d x)) \sin ^2(c+d x)}{16 d}+\frac {5 a (b+a \cot (c+d x))^3 (a-b \cot (c+d x)) \sin ^4(c+d x)}{24 d}+\frac {(b+a \cot (c+d x))^5 \sin ^6(c+d x)}{6 d}-\frac {\left (5 a \left (a^2+b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{16 d}\\ &=\frac {5}{16} a \left (a^2+b^2\right )^2 x+\frac {5 a \left (a^2+b^2\right ) (b+a \cot (c+d x)) (a-b \cot (c+d x)) \sin ^2(c+d x)}{16 d}+\frac {5 a (b+a \cot (c+d x))^3 (a-b \cot (c+d x)) \sin ^4(c+d x)}{24 d}+\frac {(b+a \cot (c+d x))^5 \sin ^6(c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.66, size = 188, normalized size = 1.49 \begin {gather*} \frac {60 a \left (a^2+b^2\right )^2 (c+d x)-15 b \left (5 a^4+6 a^2 b^2+b^4\right ) \cos (2 (c+d x))+6 b \left (-5 a^4+b^4\right ) \cos (4 (c+d x))-b \left (5 a^4-10 a^2 b^2+b^4\right ) \cos (6 (c+d x))+15 a \left (3 a^4+2 a^2 b^2-b^4\right ) \sin (2 (c+d x))+3 a \left (3 a^4-10 a^2 b^2-5 b^4\right ) \sin (4 (c+d x))+a \left (a^4-10 a^2 b^2+5 b^4\right ) \sin (6 (c+d x))}{192 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 236, normalized size = 1.87 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 187, normalized size = 1.48 \begin {gather*} -\frac {160 \, a^{4} b \cos \left (d x + c\right )^{6} - 32 \, b^{5} \sin \left (d x + c\right )^{6} + {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{5} - 10 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 12 \, d x + 12 \, c - 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} a^{3} b^{2} + 160 \, {\left (2 \, \sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4}\right )} a^{2} b^{3} + 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 12 \, d x - 12 \, c + 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} a b^{4}}{192 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.38, size = 182, normalized size = 1.44 \begin {gather*} -\frac {24 \, b^{5} \cos \left (d x + c\right )^{2} + 8 \, {\left (5 \, a^{4} b - 10 \, a^{2} b^{3} + b^{5}\right )} \cos \left (d x + c\right )^{6} + 24 \, {\left (5 \, a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{4} - 15 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} d x - {\left (8 \, {\left (a^{5} - 10 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \cos \left (d x + c\right )^{5} + 10 \, {\left (a^{5} + 2 \, a^{3} b^{2} - 7 \, a b^{4}\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 609 vs.
\(2 (117) = 234\).
time = 0.49, size = 609, normalized size = 4.83 \begin {gather*} \begin {cases} \frac {5 a^{5} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 a^{5} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {15 a^{5} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {5 a^{5} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {5 a^{5} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {5 a^{5} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac {11 a^{5} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} - \frac {5 a^{4} b \cos ^{6}{\left (c + d x \right )}}{6 d} + \frac {5 a^{3} b^{2} x \sin ^{6}{\left (c + d x \right )}}{8} + \frac {15 a^{3} b^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} + \frac {15 a^{3} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{8} + \frac {5 a^{3} b^{2} x \cos ^{6}{\left (c + d x \right )}}{8} + \frac {5 a^{3} b^{2} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{3} b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {5 a^{3} b^{2} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{8 d} - \frac {5 a^{2} b^{3} \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{2 d} - \frac {5 a^{2} b^{3} \cos ^{6}{\left (c + d x \right )}}{6 d} + \frac {5 a b^{4} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 a b^{4} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {15 a b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {5 a b^{4} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {5 a b^{4} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} - \frac {5 a b^{4} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} - \frac {5 a b^{4} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} + \frac {b^{5} \sin ^{6}{\left (c + d x \right )}}{6 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{5} \cos {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 211, normalized size = 1.67 \begin {gather*} \frac {5}{16} \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} x - \frac {{\left (5 \, a^{4} b - 10 \, a^{2} b^{3} + b^{5}\right )} \cos \left (6 \, d x + 6 \, c\right )}{192 \, d} - \frac {{\left (5 \, a^{4} b - b^{5}\right )} \cos \left (4 \, d x + 4 \, c\right )}{32 \, d} - \frac {5 \, {\left (5 \, a^{4} b + 6 \, a^{2} b^{3} + b^{5}\right )} \cos \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {{\left (a^{5} - 10 \, a^{3} b^{2} + 5 \, a b^{4}\right )} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac {{\left (3 \, a^{5} - 10 \, a^{3} b^{2} - 5 \, a b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac {5 \, {\left (3 \, a^{5} + 2 \, a^{3} b^{2} - a b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.32, size = 472, normalized size = 3.75 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (-\frac {11\,a^5}{8}+\frac {5\,a^3\,b^2}{4}+\frac {5\,a\,b^4}{8}\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-\frac {11\,a^5}{8}+\frac {5\,a^3\,b^2}{4}+\frac {5\,a\,b^4}{8}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {15\,a^5}{4}-\frac {65\,a^3\,b^2}{2}+\frac {95\,a\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {15\,a^5}{4}-\frac {65\,a^3\,b^2}{2}+\frac {95\,a\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {5\,a^5}{24}-\frac {235\,a^3\,b^2}{12}+\frac {85\,a\,b^4}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (\frac {5\,a^5}{24}-\frac {235\,a^3\,b^2}{12}+\frac {85\,a\,b^4}{24}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {100\,a^4\,b}{3}-\frac {80\,a^2\,b^3}{3}+\frac {32\,b^5}{3}\right )+40\,a^2\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+40\,a^2\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,a^4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+10\,a^4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {5\,a\,\mathrm {atan}\left (\frac {5\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{8\,\left (\frac {5\,a^5}{8}+\frac {5\,a^3\,b^2}{4}+\frac {5\,a\,b^4}{8}\right )}\right )\,{\left (a^2+b^2\right )}^2}{8\,d}-\frac {5\,a\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{8\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________